<div id="addaddress_form">
		<div id="main-content">
			<div class="two-column alpha">
				<h4 class="article-title">Sửa địa chỉ</h4>
				<form action="<{$APPLICATION_URL}>/Admin/GrouponAddress/doEdit" method="post"
					id="addaddressForm" name="addaddressForm" class="addaddressForm" >
					<ol class="forms">
						<li><label for="name">Tên địa chỉ</label><input type="text"
							id="name" name="name" value="<{$adddressEntity->name}>"></li>
						<li>
							<select name="city" id="city">
								<{foreach name=outer item=item from=$cityList}>
		                        <option value="<{$item->id}>" <{if $adddressEntity->id == $item->id}> selected="selected" <{/if}>><{$item->city_name}></option>
		                        <{/foreach}>
							</select>
						</li>
						<li><label for="address">Địa chỉ</label> <input type="text"
							id="address" name="address" value="<{$adddressEntity->address}>" />
						</li>
						<li><label for="phone">Số điện thoại</label> <input type="text"
							id="phone" name="phone" value="<{$adddressEntity->phone}>" />
						</li>
						<li>
						<input type="hidden" name="add_id" value="<{$adddressEntity->id}>">
						<input id="login-form" name="submit" type="submit" class="silver-button" value="submit" style="width:50px">
						

					</ol>
				</form>
				<div class="clear"></div>
			</div>			
		</div>
	</div>
<script type="text/javascript">
	$(document).ready(function(){
		
	$('#addaddressForm').bind("submit", function(){
	//	$.fancybox.close();
		$.ajax({
			type	: "POST",
			cache	: false,
			dataType: 'json',
			url		: "<{$APPLICATION_URL}>/Admin/GrouponAddress/doEdit",
			data		: 'add_id=<{$addressEntity->id}>&name='+$('#name').val()+'&address='+$('#address').val()+'&phone='+$('#phone').val+'&city='+$('#city').val()+'&submit=submit',
			success: function(obj) {				
				//do nothing
				if(typeof obj["success"] != "undefined" && obj['success'] == 1 ){
					$.fancybox.close();
					window.location.reload();
				}else{
					$('#error').css('display', 'block');
				}		
			}
		});
		return false;
	});
});
</script>